grep 'vi='  ~/.bashrc >/dev/null 2>&1 || echo "alias vi='vim'"  >>   ~/.bashrc
grep 'dir=' ~/.bashrc >/dev/null 2>&1 || echo "alias dir='ls -lsh'"  >>   ~/.bashrc

[ ! -d ~/.vim/autoload ] && mkdir ~/.vim/autoload || true
wget -c https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim -O ~/.vim/autoload/plug.vim
cat > ~/.vim/vimrc << 'EOF'
colorscheme desert
filetype plugin on
syntax on
set number
set softtabstop=4
set shiftwidth=4
set laststatus=2
set statusline=[%F]%m%*%=[%l:%c][%p%%]
set encoding=utf-8
set termencoding=utf-8
set fileencoding=utf-8
set fileencodings=ucs-bom,utf-8,cp936,gbk
set guifont=Consolas:h12:cANSI:qDRAFT
set nocompatible
set nobackup
set noswapfile

map <c-j> <c-w>j
map <c-k> <c-w>k
map <c-l> <c-w>l
map <c-h> <c-w>h
nnoremap QQ :qa!<CR>

call plug#begin('~/.vim/plugged')
Plug 'scrooloose/nerdtree'      
Plug 'skywind3000/asyncrun.vim' 
call plug#end()

map <F2> :NERDTreeToggle<CR>  
map <F3> :AsyncRun<Space>
map <F9> :call asyncrun#quickfix_toggle(8)<cr>  
let g:asyncrun_encs = 'gbk'   
let g:asyncrun_open = 8
EOF
